
var bu = document.getElementById("show");
var refurbish = document.getElementById("refurbish");
var x = document.getElementById("x");
var y = document.getElementById("y");
x.onmouseover = hint;
y.onmouseover = hint;
/*
*鼠标单击事件触发函数
*/
async function buOnclic(){
	let dashC = '#9900FF';//虚线（辅助线）颜色
	if(x.value == '' || y.value == ''){//检查错误
		alert('请先输入！');
		return;
	}
	let x1 = 0;
	let y1 = 0;
	try {
		x1 = eval(x.value);
		y1 = eval(y.value);
	}catch(error){
		alert("输入格式不正确，请重新输入！");
		return;
	}
	
	checkAxes(mycanvas,context,x1,y1,2);
	drowDashedLine(context,0,y1,x1,y1);
	drowDashedLine(context,x1,0,x1,y1);
	context.save();
	context.lineWidth = 3;
	await drowDashedLine2(context,0,0,x1,0,dashC);
	await drowDashedLine2(context,x1,0,x1,y1,dashC);
	await drowVector3(context,x1,y1);
	context.fillStyle = "black";
	context.font = "bold italic 20pt Times new roman";
	context.fillText('a',x1*c1,-y1*c1);
	context.restore();
}

drow2DAxes(context);
bu.addEventListener("click",buOnclic);//绑定单击事件
refurbish.onclick = function(){
	location.reload();
};